<?php

use app\assets\HomeAsset;

HomeAsset::register($this);

use yii\helpers\Html;

?>
<?php $this->beginPage(); ?>
    <!DOCTYPE html>
    <html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="Cache-Control" content="no-cache">
        <title><?php echo Html::encode($this->title); ?></title>
        <meta http-equiv="keywords" content="seo优化关键字">
        <meta http-equiv="description" content="描述信息">
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
        <meta http-equiv="Cache-Control" content="no-siteapp">
        <meta name="viewport"
              content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
        <?php $this->head(); ?>
    </head>
    <body>
    <?php $this->beginBody(); ?>
    <header class="header_h">
        <div class="header_fixed">
            <div class="header_bg ">
                <div class="logo"><img src="home/index/images/logo.png"></div>
            </div>
        </div>

    </header>

    <style>
        .tips {
            display: none;
        }
    </style>
    <div class="clear"></div>

    <!-- 轮播效果 -->
    <section>
        <div class="layui-carousel" id="lunbo">
            <div carousel-item>
                <?php foreach ($Banner as $banner):?>
                <div><a href="<?php echo $banner->url; ?>">
                        <img src="<?php echo $banner->img;?>">
                    </a>
                </div>
                <?php endforeach;?>
            </div>
        </div>
    </section>
    <div class="clear"></div>

    <!-- 查找效果 -->
    <section>
        <div class="search_component">
            <form method="get" action="list.php">
                <input type="hidden" name="c" value="job">
                <div class="formFiled">
                    <input type="text" value="" name="keyword" class="input_search"
                           placeholder="请输入职位关键字，如：家教...">
                    <input type="submit" value="搜职位" class="input_btn">
                    <i class="input_btn_icon iconfont_index_search"></i>
                </div>
            </form>
        </div>

        <!-- 分类图表导航 -->
        <div class="index_nav_content">
            <div class="swiper-container swiper-container-horizontal swiper-container-wp8-horizontal">
                <div class="swiper-wrapper">
                    <div class="swiper-slide swiper-slide-active" style="width: 100%;height: 90px;">
                        <dl class="nav_list">
                            <a href="<?php echo \yii\helpers\Url::to(['index/list', 'kind' => 2]); ?>">
                                <dt class="cor_1"><i class="nav_icon iconfont_job "></i></dt>
                                <dd>找工作</dd>
                            </a>
                        </dl>
                        <dl class="nav_list">
                            <a href="<?php echo \yii\helpers\Url::to(['common/boss-entry']); ?>">
                                <dt class="cor_2"><i class="nav_icon iconfontuser "></i></dt>
                                <dd>BOSS入驻</dd>
                            </a>
                        </dl>
                        <dl class="nav_list">
                            <a href="<?php echo \yii\helpers\Url::toRoute('index/feedback'); ?>">
                                <dt class="cor_yj"><i class="nav_icon iconfont_yj"></i></dt>
                                <dd>最新资讯</dd>
                            </a>
                        </dl>
                        <dl class="nav_list">
                            <a href="<?php echo \yii\helpers\Url::toRoute('index/about-us'); ?>">
                                <dt class="cor_sj"><i class="nav_icon iconfont_sj"></i></dt>
                                <dd>关于我们</dd>
                            </a>
                        </dl>
                    </div>
                </div>
                <!-- 如果需要分页器 -->
                <!--    <div class="swiper-pagination swiper-pagination-bullets"><span class="swiper-pagination-bullet swiper-pagination-bullet-active"></span><span class="swiper-pagination-bullet"></span></div>-->
            </div>
        </div>
    </section>
    <div class="clear"></div>

    <!--公告列表-->
    <section>
        <div class="yun_wap_notice sxl"><span class="yun_wap_notice_tit"><i class="yun_wap_notice_tit_s"></i></span>
            <ul class="yun_wap_notice_list sxlist">
                <?php foreach ($Tips as $data): ?>
                    <li>
                        <a href="<?php echo $data->url; ?>"><?php echo $data->title ?></a></li>
                <?php endforeach; ?>
            </ul>
        </div>
    </section>


    <?php
    if (empty(yii::$app->session['User']['token'])) {
        ?>
        <section>
            <div class="index_warp_content mt10">
                <div class="index_login">
                    <div class="index_login_p">您尚未登录，马上登录轻松管理信息</div>
                    <div class="index_logoin_sub">
                        <a href='<?php echo \yii\helpers\Url::toRoute('login/login'); ?>'
                           class="index_logoin_bth">登录</a>
                        <a href='<?php echo \yii\helpers\Url::toRoute('login/register'); ?>'
                           class="index_logoin_bth index_reg_bth">注册</a>
                    </div>
                </div>
            </div>
        </section>
    <?php }; ?>
    <div class="clear"></div>
    <section>
        <div class="yun_companyList">
            <ul class="clearfix">
            </ul>
        </div>
    </section>

    <div class="clear"></div>
    <section>
        <div class="index_wap_tit"><i class="index_wap_tit_icon"></i><span class="index_wap_tit_s">最新工作</span><a
                    href="<?php echo \yii\helpers\Url::toRoute(['index/list', 'kind' => 2]); ?>"
                    class="index_wap_titmore">更多&gt;&gt;</a></div>
        <div class="index_wap_hotjob ">
            <div class="clear"></div>
            <ul class="index_hotlist">
                <?php foreach ($New_job as $v): ?>  <!--指定输出 16 条数据-->
                    <li>
                        <a href="<?php echo \yii\helpers\Url::to(['user/job-resume', 'id' => $v->id]); ?>"><?php echo $v->name ?></a>
                    </li>
                <?php endforeach; ?>
            </ul>
            <div class="clear"></div>
        </div>
    </section>


    <div class="clear"></div>
    <div class="index_wap_tit"><i class="index_wap_tit_icon"></i><span class="index_wap_tit_s">职位列表</span><a
                href="<?php echo \yii\helpers\Url::toRoute('index/list'); ?>" class="index_wap_titmore">更多>></a></div>
    <ul class="job_list">
<?php foreach ($Job_list as $data): ?>
        <li>
            <a href="<?php echo \yii\helpers\Url::to(['user/job-resume', 'id' => $data->id]); ?>" class="">
                <div class="job_list_width">

                    <div class="job_kind_name"><?php echo $data->name;?></div>
                </div>
                <i class="job_kind_icon"></i>
                <div>
                    <div class="job_show_price"> <?php echo $data->general_wage;?></div>
                    <div class="job_show_request"><?php echo $data->request;?></div>
                    <div class="job_show_address"><?php echo $data->address;?></div>
                    <span class="reward_hb_ls">申请入职</span>
                </div>
            </a>
        </li>
<?php endforeach; ?>
    </ul>


    <div class="clear"></div>
    <section>
        <div class="index_wap_tit"><i class="index_wap_tit_icon"></i><span class="index_wap_tit_s">企业招聘</span><a
                    href="<?php echo \yii\helpers\Url::toRoute('index/list'); ?>"
                    class="index_wap_titmore">更多&gt;&gt;</a>
        </div>
        <div class="index_warp_jobcontent">
            <?php foreach ($Enterprise

            as $v):; ?><!-- 输出指定数量的 企业-->
            <div class="indexcom_list_box">
                <a href="<?php echo \yii\helpers\Url::to(['user/enterprise-resume', 'id' => $v->id]); ?>" class="">
                    <div class="indexcom_list_t_box">
                        <div class="indexcom_list_logo_box"><img src="<?php echo $v->photo; ?>">
                        </div>
                        <div class="indexcom_list_box_c">
                            <h3><?php echo $v->name ?></h3>
                        </div>
                        <div class="indexcom_list_box_js">
                                <span class="indexcom_list_box_js_s indexcom_list_box_js_s_hy"><i
                                            class="indexcom_list_box_js_icon indexcom_list_box_js_icon_hy"></i><?php echo $v->range ?></span>
                            <span class="indexcom_list_box_js_s"><i
                                        class="indexcom_list_box_js_icon indexcom_list_box_js_icon_map"></i><?php echo $v->address ?></span>
                        </div>
                    </div>
                </a>
            </div>
            <?php endforeach; ?>

        </div>
    </section>


    <footer>
        <div class="clear"></div>
        <div class="footer_box_bot"></div>
        <div class="footer_sum">
            <div class="bottom_sum">
                <div class="bottom_con">
                    <div class="classify ">
                        <a href="<?php echo \yii\helpers\Url::toRoute(['index/index']) ?>" id="indexclick"
                           class="fotter_nav_link">
                            <i class="footer_icon iconfont_home"></i>
                            <span class="fotter_nav_span">首页</span>
                        </a></div>
                    <div class="classify">
                        <a href="<?php echo \yii\helpers\Url::toRoute(['index/list']) . '&kind=2'; ?>"
                           class="fotter_nav_link">
                            <em class="fotter_nav_link">
                                <i class="footer_icon iconfont_jobhome"></i>
                                <span class="fotter_nav_span">找工作</span>
                            </em></a>
                    </div>


                    <div class="classify footer_nav_cur">
                        <a href="javascript:void(0);" id="jobclick" class="fotter_nav_link">
                            <i class="iconfont_homemore"></i>
                            <span class="iconfont_homemore_bg"></span> <span class="fotter_nav_span">&nbsp;</span>

                        </a>
                    </div>

                    <div class="classify">
                        <a href="<?php echo \yii\helpers\Url::toRoute(['index/list']) . '&kind=1'; ?>" id=""
                           class="fotter_nav_link">
                            <em class="fotter_nav_link">
                                <i class="footer_icon iconfont_userhome"></i> <span
                                        class="fotter_nav_span">找人才</span>
                            </em> </a>

                    </div>
                    <div class="classify"><a href="<?php echo \yii\helpers\Url::toRoute('user/index'); ?>"
                                             id="reg_mune_box" class="fotter_nav_link"> <i
                                    class="footer_icon iconfont_myhome"></i> <span class="fotter_nav_span">我的</span>
                        </a>

                    </div>
                </div>
            </div>
        </div>

        <div style="width:100%;height:100%; background:rgba(0,0,0,0.9); position:fixed;left:0px;right:0px;bottom:0px;top:0px ; z-index:10000;display:none"
             id="footerjob">
            <div class="foot_nav_close"></div>
            <div class="foot_nav_box" style="width:100%; position:absolute;">

                <ul class="foot_nav_box_list">
                    <li><a href="<?php echo \yii\helpers\Url::to(['index/list', 'kind' => 2]); ?>"
                           class="foot_nav_box_a"><span class="foot_nav_box_list_icon cor_3"><i
                                        class="nav_icon iconfont_part "></i></span>
                            <div class="foot_nav_box_name">找工作</div>
                        </a></li>
                    <li><a href="<?php echo \yii\helpers\Url::to(['index/list', 'kind' => 1]); ?>"
                           class="foot_nav_box_a"><span class="foot_nav_box_list_icon cor_2"><i
                                        class="nav_icon iconfont_comp "></i></span>
                            <div class="foot_nav_box_name">找人才</div>
                        </a></li>
                    <li><a href="<?php echo \yii\helpers\Url::toRoute('common/boss-entry'); ?>"
                           class="foot_nav_box_a"><span class="foot_nav_box_list_icon cor_7"><i
                                        class="nav_icon iconfont_tiny "></i></span>
                            <div class="foot_nav_box_name">Boss入驻</div>
                        </a></li>
                    <li><a href="<?php echo \yii\helpers\Url::toRoute('index/feedback'); ?>"
                           class="foot_nav_box_a"><span
                                    class="foot_nav_box_list_icon cor_4"><i
                                        class="nav_icon iconfont_once "></i></span>
                            <div class="foot_nav_box_name">意见反馈</div>
                        </a></li>
                    <li><a href="<?php echo \yii\helpers\Url::toRoute('index/about-us'); ?>"
                           class="foot_nav_box_a"><span
                                    class="foot_nav_box_list_icon cor_5"><i
                                        class="nav_icon iconfont_map "></i></span>
                            <div class="foot_nav_box_name">关于我们</div>
                        </a></li>
                </ul>
            </div>
        </div>
    </footer>

    <?php $this->beginBlock('index'); ?>
    //轮播js实现
    layui.use('carousel', function(){
    var carousel = layui.carousel;
    //建造实例
    carousel.render({
    elem: '#lunbo'
    ,width: '100%' //设置容器宽度
    ,height: '200px'
    ,arrow: 'hover' //始终显示箭头
    //,anim: 'updown' //切换动画方式
    });
    });

    //广播公告实现
    marquee("2000",".sxl .sxlist");
    function marquee(time,id){
    $(function(){
    var _wrap=$(id);
    var _interval=time;
    var _moving;
    _wrap.hover(function(){
    clearInterval(_moving);
    },function(){
    _moving=setInterval(function(){
    var _field=_wrap.find('li:first');
    var _h=_field.height();
    _field.animate({marginTop:-_h+'px'},800,function(){
    _field.css('marginTop',0).appendTo(_wrap);
    })
    },_interval)
    }).trigger('mouseleave');
    });
    }
    <?php $this->endBlock() ?>
    <?php $this->registerJs($this->blocks['index'], \yii\web\View::POS_END); ?>

    <?php $this->endBody(); ?>
    </body>
    </html>
<?php $this->endPage(); ?>